Review checks for Error string when checking that bad arguments are handled
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 16 Nov 2005 11:36:47 +0000 (12:36 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 16 Nov 2005 11:36:47 +0000 (12:36 +0100)
commitf1f5c0ba12b34b6e103ccaddb5dc7885fe806c40
treed9925874df4f5d5d237c9b20d447fbb510ad7f19
parent63852bee4735407c260a034cac29ee1a8f100300
Review checks for Error string when checking that bad arguments are handled
correctly.  Many checks were looking using output.find("Error") > 1, which is
incorrect, as we do not guarantee that the word "Error" will be first in the
output (never mind the fact that strings are indexed from 0).

All these checks have been changed to compare against -1.  In particular, this
should fix the failure of create_noparm_neg and create_badparm_neg on a machine
with the /etc/xen/xmdefconfig file in place, as xm create issues the
Using config file "/etc/xen/xmdefconfig" diagnostic before reporting the error.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
31 files changed:
tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py
tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py
tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py
tools/xm-test/tests/console/01_console_badopt_neg.py
tools/xm-test/tests/console/02_console_baddom_neg.py
tools/xm-test/tests/create/02_create_noparm_neg.py
tools/xm-test/tests/create/03_create_badparm_neg.py
tools/xm-test/tests/create/05_create_noroot_noram_neg.py
tools/xm-test/tests/destroy/02_destroy_noparm_neg.py
tools/xm-test/tests/destroy/03_destroy_nonexist_neg.py
tools/xm-test/tests/destroy/04_destroy_badparm_neg.py
tools/xm-test/tests/dmesg/02_dmesg_basic_neg.py
tools/xm-test/tests/help/01_help_basic_pos.py
tools/xm-test/tests/help/02_help_basic_neg.py
tools/xm-test/tests/help/03_help_badparm_neg.py
tools/xm-test/tests/help/05_help_nonroot_pos.py
tools/xm-test/tests/list/02_list_badparm_neg.py
tools/xm-test/tests/list/03_list_nonexist_neg.py
tools/xm-test/tests/list/06_list_nonroot.py
tools/xm-test/tests/memset/02_memset_badparm_neg.py
tools/xm-test/tests/pause/02_pause_badopt_neg.py
tools/xm-test/tests/pause/03_pause_badname_neg.py
tools/xm-test/tests/pause/04_pause_badid_neg.py
tools/xm-test/tests/reboot/02_reboot_badopt_neg.py
tools/xm-test/tests/reboot/03_reboot_badname_neg.py
tools/xm-test/tests/restore/02_restore_badparm_neg.py
tools/xm-test/tests/restore/03_restore_badfilename_neg.py
tools/xm-test/tests/save/02_save_badparm_neg.py
tools/xm-test/tests/save/03_save_bogusfile_neg.py
tools/xm-test/tests/shutdown/02_shutdown_badparm_neg.py
tools/xm-test/tests/shutdown/03_shutdown_nonexist_neg.py